<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibsnoel.jsp"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <%@ include file="/commons/meta.jsp"%>
  <title>资源管理,初学者论坛,BeginCode,beginCode</title>
  <!-- Bootstrap -->
  <link href="${ctx}/css/bootstrap.css" rel="stylesheet">
  <link rel="stylesheet" href="${ctx}/css/templatemo_main.css">
  <script src="${ctx}/js/jquery.min.js"></script>
  <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  <!--[if lt IE 9]>
  <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
</head>
<body>
<div id="main-wrapper">
  <div class="navbar navbar-inverse" role="navigation">
    <div class="navbar-header">
      <div class="logo"><h1>BeginCode</h1></div>
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
  </div>
  <div class="template-page-wrapper">
    <div class="navbar-collapse collapse templatemo-sidebar">
      <ul class="templatemo-sidebar-menu">
        <li><a href="index.html"><i class="fa fa-home"></i>工作台</a></li>
        <li class="sub">
          <a href="javascript:;">
            <i class="fa fa-database"></i> 内容审核 <div class="pull-right"><span class="caret"></span></div>
          </a>
          <ul class="templatemo-submenu">
            <li><a href="${ctx}/admin/blogCheck.jsp">博文审核</a></li>
            <li><a href="${ctx}/admin/blogCommentCheck.jsp">留言审核</a></li>
            <li><a href="${ctx}/admin/codeCommentCheck.jsp">代码留言审核</a></li>
          </ul>
        </li>
        <li><a href="${ctx}/resource/init"><i class="fa fa-cubes"></i>创建资源</a></li>
        <li class="sub">
          <a href="javascript:;">
            <i class="fa fa-database"></i>教程管理 <div class="pull-right"><span class="caret"></span></div>
          </a>
          <ul class="templatemo-submenu">
            <li><a href="${ctx}/admin/blogCheck.jsp">教程管理</a></li>
            <li><a href="${ctx}/course/init">创建教程</a></li>
            <li><a href="${ctx}/admin/codeCommentCheck.jsp">章节管理</a></li>
            <li><a href="${ctx}/chapter/wordChapter/init">创建章节</a></li>
          </ul>
        </li>
        <%--<li><a href="#"><i class="fa fa-map-marker"></i><span class="badge pull-right">42</span>Maps</a></li>--%>
        <%--<li class="active"><a href="#"><i class="fa fa-users"></i><span class="badge pull-right">NEW</span>Manage Users</a></li>--%>
        <%--<li><a href="#"><i class="fa fa-cog"></i>Preferences</a></li>--%>
        <li><a href="#" data-toggle="modal" data-target="#confirmModal"><i class="fa fa-sign-out"></i>退出</a></li>
      </ul>
    </div><!--/.navbar-collapse -->

    <div class="templatemo-content-wrapper">
      <div class="templatemo-content">
        <ol class="breadcrumb">
          <li>工作台</li>
          <li>资源编辑</li>
        </ol>
        <div class="row">
          <div class="col-md-12">
            <form role="form" id="resourceForm" name="resourceForm" action=""	method="post">
              <div class="form-group">
                <label for="resourceTypeId"><span class="labelinfoblue"></span>资源分类</label>
                <select class="form-control" name="resourceTypeId" id="resourceTypeId"	value="">
                  <c:forEach items="${resourceTypes }" var="resourceType">
                    <option value="${resourceType.resourceTypeId }" ${resourceType.resourceTypeId eq resource.resourceTypeId? 'selected':''  }  >${resourceType.resourceTypeName}</option>
                  </c:forEach>
                </select>
              </div>
              <div class="form-group">
                <label for="resourceName"><span class="labelinfowarn"></span>资源名称</label>
                <input type="text" class="form-control required" id="resourceName"	name="resourceName" value="${resource.resourceName}" placeholder="资源名称">
              </div>
              <div class="form-group">
                <label for="resourceAbstract"><span
                        class="labelinfosuccess"></span>资源摘要</label>
								<textarea class="form-control required" id="resourceAbstract" name="resourceAbstract" rows="3"
                                          placeholder="我们提议，为您的资源添加摘要，这也是给阅读者一个引导">${resource.resourceAbstract}</textarea>
              </div>
              <div class="form-group">
                <label for="resourceContent"><span class="labelinfodanger"></span>资源介绍</label>
                <input type="hidden" name="resourceContent" class="required" id="resourceContent" value="" />
                <div id="summernote"></div>
              </div>
              <div class="form-group">
                <label for="pic"><span
                        class="labelinfogreen"></span>资源主图</label>
                <input type="hidden" name="pic" class="form-control required"  id="pic" value="" />
                <input type="file" class=" required" name="upfile"  onchange="handleFiles(this.files)" id="upfile">
              </div>
              <div class="form-group">
                <label for="downAddr"><span
                        class="labelinfodu"></span>下载地址</label>
                <input type="text" name="downAddr" class="form-control required"  id="downAddr" value="" />
              </div>

              <div style="margin-top: 10px; text-align: center;">
                <button type="button" class="btn btn-primary" id="resourceSend"
                        style="width: 100px;">提交</button>
                <!-- 								&nbsp;&nbsp;&nbsp;&nbsp; -->
                <!-- 								<button type="button" style="width: 100px;" -->
                <!-- 									class="btn btn-primary">保存草稿</button> -->
              </div>
              <div>
                <font color="red"><b>${msg }</b></font>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
    <footer class="templatemo-footer">
      <div class="templatemo-copyright">
        <p>Copyright  <a href="http://www.begincode.net/" target="_blank">BeginCode</a></p>
      </div>
    </footer>
  </div>
</div>

                <script src="${ctx}/js/templatemo_script.js"></script>
                <script src="${ctx}/js/bootstrap.min.js"></script>
                <script type="text/javascript" src="${ctx}/js/summernote/lang/summernote-zh-CN.js"></script>
                <script src="${ctx}/js/summernote/summernote.min.js"></script>
                <link href="${ctx}/css/summernote/font-awesome.min.css"	rel="stylesheet">
                <link href="${ctx}/css/summernote/summernote.css" rel="stylesheet">
                <script src="${ctx}/js/validate/jquery.validate.js"></script>
                <script src="${ctx}/js/validate/jquery.metadata.js"></script>
                <script src="${ctx}/js/validate/messages_zh.js"></script>
                <script src="${ctx}/js/ajaxfileupload.js"></script>
                <script src="${ctx}/js/resource/resourceEdit.js"></script>
                <script src="${ctx}/js/summernote/summernotePlugin.js"></script>
                <script>
                  var ctx = "${ctx}";
                </script>

</body>
</html>